package com.aspose.cells.b.c.a;

public final class za {
   private final String[] b;
   private final za.za[] c;
   private final int d;

   public za(String... var1) {
      this.b = var1;
      int var2 = b(this.b.length);
      this.c = new za.za[var2];
      this.d = var2 - 1;

      for(int var3 = 0; var3 < this.b.length; ++var3) {
         String var4 = this.b[var3];

         assert var4 != null : "The map doesn't accept null keys.";

         int var5 = var4.hashCode();
         int var6 = a(var5);

         while(true) {
            int var7 = var6 & this.d;
            za.za var8 = this.c[var7];
            if (var8 == null) {
               this.c[var7] = new za.za(var4, var3);
               break;
            }

            if (var8.a.equals(var4)) {
               throw new IllegalArgumentException("duplicate key: " + var4);
            }

            ++var6;
         }
      }

   }

   public int a(String var1) {
      if (var1 == null) {
         return -1;
      } else {
         int var2 = a(var1.hashCode());

         while(true) {
            int var3 = var2 & this.d;
            za.za var4 = this.c[var3];
            if (var4 == null) {
               return -1;
            }

            if (var4.a.equals(var1)) {
               return var4.b;
            }

            ++var2;
         }
      }
   }

   private static int a(int var0) {
      var0 ^= var0 >>> 20 ^ var0 >>> 12;
      return var0 ^ var0 >>> 7 ^ var0 >>> 4;
   }

   private static int b(int var0) {
      if (var0 < 536870912) {
         return Integer.highestOneBit(var0) << 2;
      } else {
         assert var0 < 1073741824 : "collection too large";

         return 1073741824;
      }
   }

   public String toString() {
      StringBuilder var1 = (new StringBuilder(this.b.length * 16)).append('{');
      String[] var2 = this.b;
      int var3 = var2.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         String var5 = var2[var4];
         var1.append(var5).append(" : ").append(this.a(var5)).append("\r\n");
      }

      return var1.append('}').toString();
   }

   static class za {
      final String a;
      final int b;

      za(String var1, int var2) {
         assert var1 != null;

         this.a = var1;
         this.b = var2;
      }
   }
}
